package com.example.demo.cmiemail;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

/**
 * Created by Hy on 2018/8/6.
 */
@Component
@PropertySource("classpath:application.properties")
public class SystemUtil {
    public static String CMINOCEMAIL;//cmi邮箱网址

    public static String CMINOCEMAILUSER;//cmi用户名

    public static String CMINOCEMAILPWD;//cmi密码

    public static String CMINOCEMAILURL;//登录url

    public static String HOST_NAME;// 服务器地址

    public static String USER;// 账号

    public static String PASSWORD;//密码

    public static String CHARSET;//编码格式

    public static String TITLE;//标题

    public static String BASE_CONTENT;//验证码基本内容

    public static String FROM;//发送人邮箱

    public static String RESET_PWD_TITLE;//重置密码的标题

    public static String RESET_PWD_CONTENT;//重置密码的内容

    public static String SET_PWD_TITLE;//设置密码的标题

    public static String SET_PWD_CONTENT;//设置密码的内容

    public static String RESET_PWD_HREF;//重置密码链接

    public static String FROM_NAME;//发送者名称

    public static String emailFlag;//邮件发送开关

    @Value("crm.cminocEmail")
    public static void setCMINOCEMAIL(String CMINOCEMAIL) {
        SystemUtil.CMINOCEMAIL = CMINOCEMAIL;
    }
    @Value("${crm.cminocEmailUser}")
    public static void setCMINOCEMAILUSER(String CMINOCEMAILUSER) {
        SystemUtil.CMINOCEMAILUSER = CMINOCEMAILUSER;
    }
    @Value("${crm.cminocEmailPWD}")
    public static void setCMINOCEMAILPWD(String CMINOCEMAILPWD) {
        SystemUtil.CMINOCEMAILPWD = CMINOCEMAILPWD;
    }
    @Value("${crm.cminocEmailURL}")
    public static void setCMINOCEMAILURL(String CMINOCEMAILURL) {
        SystemUtil.CMINOCEMAILURL = CMINOCEMAILURL;
    }
    @Value("${cmiemail.host_name}")
    public static void setHostName(String hostName) {
        HOST_NAME = hostName;
    }
    @Value("${cmiemail.user}")
    public static void setUSER(String USER) {
        SystemUtil.USER = USER;
    }
    @Value("${cmiemail.password}")
    public static void setPASSWORD(String PASSWORD) {
        SystemUtil.PASSWORD = PASSWORD;
    }
    @Value("${cmiemail.charset}")
    public static void setCHARSET(String CHARSET) {
        SystemUtil.CHARSET = CHARSET;
    }
    @Value("${cmiemail.title}")
    public static void setTITLE(String TITLE) {
        SystemUtil.TITLE = TITLE;
    }
    @Value("${cmiemail.base_content}")
    public static void setBaseContent(String baseContent) {
        BASE_CONTENT = baseContent;
    }
    @Value("${cmiemail.from}")
    public static void setFROM(String FROM) {
        SystemUtil.FROM = FROM;
    }
    @Value("${cmiemail.reset_pwd_title}")
    public static void setResetPwdTitle(String resetPwdTitle) {
        RESET_PWD_TITLE = resetPwdTitle;
    }
    @Value("${cmiemail.reset_pwd_content}")
    public static void setResetPwdContent(String resetPwdContent) {
        RESET_PWD_CONTENT = resetPwdContent;
    }
    @Value("${cmiemail.set_pwd_title}")
    public static void setSetPwdTitle(String setPwdTitle) {
        SET_PWD_TITLE = setPwdTitle;
    }
    @Value("${cmiemail.set_pwd_content}")
    public static void setSetPwdContent(String setPwdContent) {
        SET_PWD_CONTENT = setPwdContent;
    }
    @Value("${cmiemail.reset_pwd_href}")
    public static void setResetPwdHref(String resetPwdHref) {
        RESET_PWD_HREF = resetPwdHref;
    }
    @Value("${cmiemail.from_name}")
    public static void setFromName(String fromName) {
        FROM_NAME = fromName;
    }
    @Value("${cmiemail.flag}")
    public static void setEmailFlag(String emailFlag) {
        SystemUtil.emailFlag = emailFlag;
    }
}
